<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %><%--
  Created by IntelliJ IDEA.
  User: Teacher
  Date: 2023/11/22
  Time: 13:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
<%--    <link rel="stylesheet" href="../assets/bootstrap/css/bootstrap.min.css">--%>
    <link rel="stylesheet" href="<%= request.getContextPath() %>/assets/bootstrap/css/bootstrap.min.css">
</head>
<body>
<%--    <%= request.getContextPath() %>--%>
    <h4>users数据库的数据列表</h4>
    <table class="table table-bordered table-hover">
        <thead class="table-dark">
            <tr>
                <td>编码</td>
                <td>姓名</td>
                <td>登录名</td>
                <td>性别</td>
            </tr>
        </thead>
        <tbody>
            <%
                List<User> list = (List<User>) request.getAttribute("userList");
                for (int i = 0; i < list.size(); i++) {
            %>
            <tr>
                <td><%= list.get(i).getId() %></td>
                <td><%= list.get(i).getName() %></td>
                <td><%= list.get(i).getUsername() %></td>
                <td>
                    <%
                        if(list.get(i).getSex()==0){
                            out.print("未知");
                        }else if(list.get(i).getSex()==1){
                            out.print("男");
                        }else if(list.get(i).getSex()==2){
                            out.print("女");
                        }
                    %>
                </td>
            </tr>
            <%
                };
            %>
        </tbody>
    </table>
</body>
</html>
